.class public Lcom/xingbook/group/view/FixGridLayout;
.super Landroid/view/ViewGroup;


# instance fields
.field public a:I

.field public b:I

.field public c:I

.field public d:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    const/16 v1, 0x11

    const/4 v0, 0x5

    invoke-direct {p0, p1}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;)V

    iput v0, p0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    iput v0, p0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    iput v1, p0, Lcom/xingbook/group/view/FixGridLayout;->c:I

    iput v1, p0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 2

    const/16 v1, 0x11

    const/4 v0, 0x5

    invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    iput v0, p0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    iput v0, p0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    iput v1, p0, Lcom/xingbook/group/view/FixGridLayout;->c:I

    iput v1, p0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 2

    const/16 v1, 0x11

    const/4 v0, 0x5

    invoke-direct {p0, p1, p2, p3}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    iput v0, p0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    iput v0, p0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    iput v1, p0, Lcom/xingbook/group/view/FixGridLayout;->c:I

    iput v1, p0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    return-void
.end method


# virtual methods
.method protected onLayout(ZIIII)V
    .locals 17
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "DrawAllocation"
        }
    .end annotation

    sub-int v1, p4, p2

    invoke-virtual/range {p0 .. p0}, Lcom/xingbook/group/view/FixGridLayout;->getPaddingLeft()I

    move-result v2

    sub-int/2addr v1, v2

    invoke-virtual/range {p0 .. p0}, Lcom/xingbook/group/view/FixGridLayout;->getPaddingRight()I

    move-result v2

    sub-int v7, v1, v2

    sub-int v1, p5, p3

    invoke-virtual/range {p0 .. p0}, Lcom/xingbook/group/view/FixGridLayout;->getPaddingTop()I

    move-result v2

    sub-int/2addr v1, v2

    invoke-virtual/range {p0 .. p0}, Lcom/xingbook/group/view/FixGridLayout;->getPaddingBottom()I

    move-result v2

    sub-int v6, v1, v2

    const/4 v5, 0x0

    new-instance v8, Ljava/util/ArrayList;

    invoke-direct {v8}, Ljava/util/ArrayList;-><init>()V

    new-instance v9, Ljava/util/ArrayList;

    invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V

    new-instance v10, Ljava/util/ArrayList;

    invoke-direct {v10}, Ljava/util/ArrayList;-><init>()V

    new-instance v11, Ljava/util/ArrayList;

    invoke-direct {v11}, Ljava/util/ArrayList;-><init>()V

    invoke-virtual/range {p0 .. p0}, Lcom/xingbook/group/view/FixGridLayout;->getChildCount()I

    move-result v12

    const/4 v4, 0x0

    const/4 v3, 0x0

    const/4 v2, 0x0

    const/4 v1, 0x0

    move/from16 v16, v1

    move v1, v4

    move v4, v3

    move v3, v5

    move/from16 v5, v16

    :goto_0
    if-lt v5, v12, :cond_1

    move v1, v3

    :goto_1
    invoke-virtual {v11}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-nez v3, :cond_6

    :cond_0
    return-void

    :cond_1
    move-object/from16 v0, p0

    invoke-virtual {v0, v5}, Lcom/xingbook/group/view/FixGridLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v13

    invoke-virtual {v13}, Landroid/view/View;->getMeasuredWidth()I

    move-result v14

    invoke-virtual {v13}, Landroid/view/View;->getMeasuredHeight()I

    move-result v13

    invoke-static {v13}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v15

    invoke-virtual {v8, v15}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v15

    invoke-virtual {v9, v15}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    move-object/from16 v0, p0

    iget v15, v0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    add-int/2addr v15, v13

    if-le v15, v1, :cond_2

    move-object/from16 v0, p0

    iget v1, v0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    add-int/2addr v1, v13

    add-int v13, v3, v1

    move-object/from16 v0, p0

    iget v15, v0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    add-int/2addr v13, v15

    if-le v13, v6, :cond_2

    move-object/from16 v0, p0

    iget v1, v0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    add-int/2addr v1, v3

    goto :goto_1

    :cond_2
    add-int v13, v4, v14

    move-object/from16 v0, p0

    iget v15, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    mul-int/lit8 v15, v15, 0x2

    add-int/2addr v13, v15

    if-le v13, v7, :cond_5

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v13

    invoke-virtual {v10, v13}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    move-object/from16 v0, p0

    iget v13, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v13, v4

    invoke-static {v13}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v13

    invoke-virtual {v11, v13}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    move-object/from16 v0, p0

    iget v13, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v13, v4

    if-le v13, v2, :cond_3

    move-object/from16 v0, p0

    iget v2, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v2, v4

    :cond_3
    add-int v4, v3, v1

    const/4 v3, 0x0

    const/4 v1, 0x0

    :goto_2
    if-lez v1, :cond_4

    move-object/from16 v0, p0

    iget v13, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v13, v1

    invoke-static {v13}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v13

    invoke-virtual {v11, v13}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v13

    invoke-virtual {v10, v13}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    :cond_4
    add-int/lit8 v5, v5, 0x1

    move/from16 v16, v1

    move v1, v3

    move v3, v4

    move/from16 v4, v16

    goto/16 :goto_0

    :cond_5
    move-object/from16 v0, p0

    iget v13, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v13, v14

    add-int/2addr v4, v13

    move/from16 v16, v4

    move v4, v3

    move v3, v1

    move/from16 v1, v16

    goto :goto_2

    :cond_6
    const/4 v4, 0x0

    const/4 v3, 0x0

    const/4 v5, 0x0

    move-object/from16 v0, p0

    iget v8, v0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    and-int/lit8 v8, v8, 0x30

    const/16 v9, 0x30

    if-ne v8, v9, :cond_8

    const/4 v1, 0x0

    :goto_3
    const/4 v6, 0x0

    move-object/from16 v0, p0

    iget v3, v0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    and-int/lit8 v3, v3, 0x3

    const/4 v8, 0x3

    if-ne v3, v8, :cond_a

    :cond_7
    :goto_4
    move-object/from16 v0, p0

    iget v2, v0, Lcom/xingbook/group/view/FixGridLayout;->b:I

    add-int/2addr v2, v1

    const/4 v4, 0x0

    move v3, v6

    :goto_5
    if-ge v4, v12, :cond_0

    move-object/from16 v0, p0

    invoke-virtual {v0, v4}, Lcom/xingbook/group/view/FixGridLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v8

    invoke-virtual {v8}, Landroid/view/View;->getMeasuredWidth()I

    move-result v9

    invoke-virtual {v8}, Landroid/view/View;->getMeasuredHeight()I

    move-result v13

    if-ne v3, v6, :cond_10

    move-object/from16 v0, p0

    iget v1, v0, Lcom/xingbook/group/view/FixGridLayout;->c:I

    and-int/lit8 v1, v1, 0x3

    const/4 v14, 0x3

    if-ne v1, v14, :cond_c

    add-int/lit8 v3, v3, 0x0

    :goto_6
    if-lez v5, :cond_10

    add-int/lit8 v1, v5, -0x1

    invoke-virtual {v10, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    add-int/2addr v1, v2

    move v2, v3

    :goto_7
    move-object/from16 v0, p0

    iget v3, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v3, v2

    add-int v2, v3, v9

    move-object/from16 v0, p0

    iget v14, v0, Lcom/xingbook/group/view/FixGridLayout;->a:I

    add-int/2addr v2, v14

    if-le v2, v7, :cond_f

    add-int/lit8 v3, v5, 0x1

    add-int/lit8 v2, v4, -0x1

    move v4, v6

    :goto_8
    add-int/lit8 v2, v2, 0x1

    move v5, v3

    move v3, v4

    move v4, v2

    move v2, v1

    goto :goto_5

    :cond_8
    move-object/from16 v0, p0

    iget v8, v0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    and-int/lit8 v8, v8, 0x50

    const/16 v9, 0x50

    if-ne v8, v9, :cond_9

    sub-int v1, v6, v1

    goto :goto_3

    :cond_9
    move-object/from16 v0, p0

    iget v8, v0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    and-int/lit8 v8, v8, 0x10

    const/16 v9, 0x10

    if-ne v8, v9, :cond_11

    sub-int v1, v6, v1

    div-int/lit8 v1, v1, 0x2

    goto :goto_3

    :cond_a
    move-object/from16 v0, p0

    iget v3, v0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    and-int/lit8 v3, v3, 0x5

    const/4 v8, 0x5

    if-ne v3, v8, :cond_b

    sub-int v2, v7, v2

    add-int/2addr v2, v4

    goto :goto_4

    :cond_b
    move-object/from16 v0, p0

    iget v3, v0, Lcom/xingbook/group/view/FixGridLayout;->d:I

    and-int/lit8 v3, v3, 0x1

    const/4 v8, 0x1

    if-ne v3, v8, :cond_7

    sub-int v2, v7, v2

    div-int/lit8 v2, v2, 0x2

    add-int/2addr v2, v4

    goto/16 :goto_4

    :cond_c
    move-object/from16 v0, p0

    iget v1, v0, Lcom/xingbook/group/view/FixGridLayout;->c:I

    and-int/lit8 v1, v1, 0x5

    const/4 v14, 0x5

    if-ne v1, v14, :cond_d

    invoke-virtual {v11, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    sub-int v1, v7, v1

    add-int/2addr v3, v1

    goto :goto_6

    :cond_d
    move-object/from16 v0, p0

    iget v1, v0, Lcom/xingbook/group/view/FixGridLayout;->c:I

    and-int/lit8 v1, v1, 0x1

    const/4 v14, 0x1

    if-ne v1, v14, :cond_e

    invoke-virtual {v11, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    sub-int v1, v7, v1

    div-int/lit8 v1, v1, 0x2

    add-int/2addr v3, v1

    goto/16 :goto_6

    :cond_e
    add-int/lit8 v3, v3, 0x0

    goto/16 :goto_6

    :cond_f
    add-int v2, v3, v9

    add-int v9, v1, v13

    invoke-virtual {v8, v3, v1, v2, v9}, Landroid/view/View;->layout(IIII)V

    move v3, v5

    move/from16 v16, v4

    move v4, v2

    move/from16 v2, v16

    goto/16 :goto_8

    :cond_10
    move v1, v2

    move v2, v3

    goto/16 :goto_7

    :cond_11
    move v1, v3

    goto/16 :goto_3
.end method

.method protected onMeasure(II)V
    .locals 3

    const/4 v1, 0x0

    move v0, v1

    :goto_0
    invoke-virtual {p0}, Lcom/xingbook/group/view/FixGridLayout;->getChildCount()I

    move-result v2

    if-lt v0, v2, :cond_0

    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->onMeasure(II)V

    return-void

    :cond_0
    invoke-virtual {p0, v0}, Lcom/xingbook/group/view/FixGridLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2, v1, v1}, Landroid/view/View;->measure(II)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method
